package wdevent

import "time"

var default_event I_Event

var default_time_event T_Event

func init() {
	default_event = NewEvent()
	default_time_event = NewTimeEvent(10 * time.Second)
}

//--------------------------------正常事件默认系统----------------------------------

//AddEvent ..添加事件
func AddEvent(key string, call EventCall) {
	default_event.AddEvent(key, call)
}

//RemoveEvent ..移除事件
func RemoveEvent(key string) {
	default_event.RemoveEvent(key)
}

//ExecEvent ..执行事件
func ExecEvent(key string, offset interface{}) {
	default_event.ExecEvent(key, offset)
}

//Clear ..删除全部事件
func Clear() {
	default_event.Clear()
}

//---------------------------------时间事件默认系统-------------------------------
//AddTimeEvent ..添加事件
func AddTimeEvent(key string, cycletime int64, stat bool, call func(nowtime int64)) {
	default_time_event.AddEvent(key, cycletime, stat, call)
}

//default_time_event  ..移除事件
func RemoveTimeEvent(key string) {
	default_time_event.RemoveEvent(key)
}

//StopTime ..删除全部事件
func StopTime() {
	default_time_event.Stop()
}

//ClearTime ..删除全部事件
func ClearTime() {
	default_time_event.Clear()
}
